<?xml version="1.0" encoding="utf-8" ?>
<workflow.netreport>
	<version number="1.9"/>
	<reportypes>
		<!--<reportype value="Detailed Report"   displayformat="value"    classname="Workflow.NET.Web.ReportUI.DetailedReport" assembly="Bin\Workflow.NET.Web.ReportUI.dll" />-->
		<reportype value="Analyze Workflows" displayformat="value"    classname="Workflow.NET.Web.ReportUI.AnalyzeWorkflows" assembly="Bin\Workflow.NET.Web.ReportUI.dll" />
		<!--<reportype value="Graphical Analysis" displayformat="value"    classname="Workflow.NET.Web.ReportUI.ReportWebChart" assembly="Bin\Workflow.NET.Web.ReportUI.dll" />-->
		<!--<reportype value="Summary Report"    displayformat="category" classname="" assembly="" />-->
		<!--<reportype value="Workflow Summary"  displayformat="value"    classname="Workflow.NET.Web.ReportUI.SummaryReport" assembly="Bin\Workflow.NET.Web.ReportUI.dll" />-->
		<!--<reportype value="Action Summary"    displayformat="value"    classname="Workflow.NET.Web.ReportUI.SummaryReport" assembly="Bin\Workflow.NET.Web.ReportUI.dll" />-->
		<!--<reportype value="Resource Summary"  displayformat="value" classname="Workflow.NET.Web.ReportUI.SummaryReport" assembly="Bin\Workflow.NET.Web.ReportUI.dll" />-->
	</reportypes>
	<reportypequeries>
		<reporttypequery name="graphical analysis">
			<query name="graphicalanalysisquery" type="parent">
				<add action="append" position="select">
					<![CDATA[ SWD.ActionName, SWD.ActionType, ]]>
				</add>
				<add action="append" position="select">
					<datasource type="default">
						<![CDATA[ Convert(datetime, Avg(Convert(Real, SWD.ExecutionEndedAt-SWD.StartedOn))) AS AvgTimeTaken  ]]>
					</datasource>
					<datasource type="sql server">
						<![CDATA[ Convert(datetime, Avg(Convert(Real, SWD.ExecutionEndedAt-SWD.StartedOn))) AS AvgTimeTaken  ]]>
					</datasource>
					<datasource type="oracle oledb">
						<![CDATA[ to_date('1/1/1900','MM/DD/YYYY HH24:MI:SS') + avg(SWD.ExecutionEndedAt - SWD.StartedOn) as "AvgTimeTaken" ]]>
					</datasource>
					<datasource type="access oleDb">
						<![CDATA[ #1/1/1900# + Avg(SWD.ExecutionEndedAt-SWD.StartedOn) AS AvgTimeTaken ]]>
					</datasource>					
				</add>
				<add action="append" position="from">
					<![CDATA[ SWExecute SW , SWExecutionDetails SWD ]]>
				</add>
				<add action="append" position="where">
					<![CDATA[ SW.Id = SWD.ExecutionId ]]>
				</add>
				<add action="append" position="fields" >
					<![CDATA[AND SW.Application = ]]>
					<value selectvalue="application" format="string" />
				</add>
				<add action="append" position="fields" >
					<![CDATA[ AND SW.Name in ( ]]>
				</add>
				<add action="append" position="fields" >
					<value selectvalue="workflow" format="string" valueseperator=","/>
				</add>
				<add action="append" position="fields" >
					<![CDATA[ )]]>
				</add>
				<add action="append" position="fields" >
					<![CDATA[ AND SW.InternalStatus in (<bookmark name="replacestatus"/>)]]>					
				</add>
				<add action="replace" position="replacestatus" type="bookmark">
					<value selectvalue="InternalStatus" format="string" valueseperator=","/>
				</add>
				<add action="append" position="end" >
					<datasource type="default">
						<![CDATA[ GROUP By SWD.ActionName,SWD.ActionType ]]>
					</datasource>
					<datasource type="sql server">
						<![CDATA[ AND SWD.ExecutionEndedAt Is Not Null GROUP By SWD.ActionName,SWD.ActionType ]]>
					</datasource>
					<datasource type="access oleDb">
						<![CDATA[ AND NOT IsNull(SWD.ExecutionEndedAt) GROUP By SWD.ActionName,SWD.ActionType ]]>
					</datasource>
					<datasource type="oracle oledb">
						<![CDATA[ AND SWD.ExecutionEndedAt Is Not Null GROUP By SWD.ActionName,SWD.ActionType ]]>
					</datasource>
				</add>
			</query>
		</reporttypequery>
		<reporttypequery name="workflow summary">
			<query name="workflowsummaryquery">
				<add action="append" position="select">
					<![CDATA[ SW.Application , SW.Name as WfName, SW.InternalStatus , count(SW.InternalStatus) 
					As WFStatusCount ]]>
				</add>
				<add action="append" position="from">
					<![CDATA[ SWExecute SW ]]>
				</add>
				<add action="append" position="where" >
					<![CDATA[SW.Application = ]]>
					<value selectvalue="application" format="string" />
				</add>
				<add action="append" position="fields" >
					<![CDATA[ AND SW.Name in ( ]]>
				</add>
				<add action="append" position="fields" >
					<value selectvalue="workflow" format="string" valueseperator=","/>
				</add>
				<add action="append" position="fields" >
					<![CDATA[ )]]>
				</add>
				<add action="append" position="end" >
					<![CDATA[ Group By SW.InternalStatus ,SW.Name,SW.Application Order By SW.Name ]]>
				</add>
			</query>
		</reporttypequery>
		<reporttypequery name="action summary">
			<query name="actionsummaryquery">
				<add action="append" position="select">
					<![CDATA[ SW.Application , SW.Name as WfName, SWED.Status ,
					count(SWED.Status) as ActionCount  ]]>
				</add>
				<add action="append" position="from">
					<![CDATA[ SWExecute SW , SWExecutionDetails SWED  ]]>
				</add>
				<add action="append" position="where">
					<![CDATA[SW.ID = SWED.ExecutionId ]]>				
				</add>				
				<add action="append" position="fields" >
					<![CDATA[ AND SW.Application = ]]>
					<value selectvalue="application" format="string" />
				</add>
				<add action="append" position="fields" >
					<![CDATA[ AND SW.Name in ( ]]>
				</add>
				<add action="append" position="fields" >
					<value selectvalue="workflow" format="string" valueseperator=","/>
				</add>
				<add action="append" position="fields" >
					<![CDATA[ )]]>
				</add>
				<add action="append" position="end" >
					<![CDATA[ Group By SWED.Status , SW.Name, SW.Application Order By SW.Name]]>
				</add>
			</query>
		</reporttypequery>
		<reporttypequery name="resource summary">
			<query name="resourcesummaryquery">
				<add action="append" position="select">
					<![CDATA[ SW.Application , SW.Name as WfName , SWA.Status ,
					count(SWA.Status) as ResourceCount  ]]>
				</add>
				<add action="append" position="from">
					<![CDATA[ SWExecute SW , SWExecutionDetails SWED ,SWActivityList SWA  ]]>
				</add>
				<add action="append" position="where">
					<![CDATA[SW.ID = SWED.ExecutionId 
					AND SWA.ExecutionDetailsId = SWED.Id AND SW.ID = SWA.ExecutionId ]]>				
				</add>				
				<add action="append" position="fields" >
					<![CDATA[ AND SW.Application = ]]>
					<value selectvalue="application" format="string" />
				</add>
				<add action="append" position="fields" >
					<![CDATA[ AND SW.Name in ( ]]>
				</add>
				<add action="append" position="fields" >
					<value selectvalue="workflow" format="string" valueseperator=","/>
				</add>
				<add action="append" position="fields" >
					<![CDATA[ )]]>
				</add>
				<add action="append" position="end" >
					<![CDATA[ Group By SWA.Status , SW.Name, SW.Application Order By SW.Name]]>
				</add>
			</query>
		</reporttypequery>
	</reportypequeries>
</workflow.netreport>